<template>
    <div style="background-color: Transparent;width: 450px;margin:0px auto;margin-top: 150px">
        <h1 align="center">用户登录</h1>
        <div style="margin-left: 60px">
            <span>账号：</span>
            <el-input v-model="managers.nicknme" placeholder="请输入内容" style="width: 250px"></el-input>
            <br>
            <br>
            <span>密码：</span>
            <el-input v-model="managers.pwd" placeholder="请输入内容" style="width: 250px"></el-input>
            <br>
            <br>
        </div>
        <div>
            <el-button type="button" style="width:150px;display:block;margin:0 auto;background-color:Transparent;"><a
                    href="javascript:;" @click="login(managers)">登陆</a></el-button>
        </div>
    </div>
</template>

<script>
    export default {
        name: "login",
        data() {
            return {
                managers: {
                    id: '',
                    storeid: '',
                    nicknme: '',
                    pwd: '',
                    name: '',
                    phone: '',
                    idcard: '',
                    sex: '',
                    job: '',
                }
            }   
        },
        methods: {
            login: function (managers) {
                this.axios.post("/Managers/Login", managers).then(response => {
                    if (response.data == null || response.data == "") {
                        alert("用户名和密码不对!");
                    } else {
                        alert("登陆成功！");
                        this.$router.push({path: '/storefont_main'});
                    }
                }).catch((error) => {
                    alert(error)
                });
            }
        }
    }
</script>

<style scoped>

</style>